<?php

#namespace Giocondo;

# linkButton -- A widget which can be used to direct the user to a www uri.
class LinkButton extends Widget {
	protected $options = array(
		'onClicked' => '',
		'text'      => '',
		'uri'       => ''
	);

	#const default_option = 'uri';
	public $default_option = 'uri';

	public function onClicked() {
		return $this->onEvent('onClicked', 'u');
	}

	public function display($options=array()) {
		parent::display('onClicked');

		XHtml::start_tag('button', array('id' => $this->id));
		# TODO: test, set default normal relief
		XHtml::element('a', $this->options['text'] != '' ?
			$this->options['text'] : $this->options['uri'],
			array('uri' => $this->options['uri']));
		XHtml::end_tag('fieldset');
	}
}

# End of file
# vim: set ts=2 sw=2 noet:
?>
